const languageData = {
    'zh-CN': {
        nav1: '序章',
        nav2: '纹样',
        nav3: '色彩',
        nav4: '形制',
        langButton: '中文',
        Minnan:'闽南布袋木偶戏',
        Minnantext1:"闽南布袋木偶戏是福建木偶戏代表剧种之一，承载着丰富的历史文化内涵。它以闽南傀儡调作为主要音乐唱腔，吸收了梨园戏和南音的部分曲牌；并在演出中融入当地的历史文化与民俗风情，赋予了戏剧生活气息；以精湛的雕刻技艺搭配传统戏剧服饰，使其成为福建戏剧之瑰宝。",
        Minnantext2:" 本次展出的内容分为三个部分：纹饰戏语——《女中魁》服饰纹样；锦色戏韵——《李东假巡案》服饰色彩；偶影衣形——《大名府》服装造型。 ",
        font1:'关于我们',
        font2:'帮助中心',
        font3:'教育资源',
        font4:'© Minnan Puppet 2024, 版权所有',
        weishi1:'纹饰戏语',
        weishi2:'《李东假巡案》服饰纹样',
        weishi3:'《李东假巡案》',
        weishi4:'《李东假巡案》讲述了明朝天启年间，李东“以假乱真”，代替真巡按李彦彬将贪赃枉法的苏州',
        weishi5:' 知府张春、总督方玉壁绳之以法的故事。',
        weishi6:'开始探索',
        jinse1:'锦色戏韵',
        jinse2:'《女中魁》服饰色彩',
        jinse3:'《女中魁》讲述了满娇容与其丈夫进京赶考，途中遇海盗，满娇容为护夫坠海后，与丈夫走散，',
        jinse4:'为寻找丈夫，女扮男装，历经困难，成为武状元为朝廷效力，并凭借自己的毅力与智慧，与丈夫',
        jinse5:'团聚，也获得皇帝的赏识，授予“女中魁”的称号。',
        jinse6:'《女中魁》',
        jinse7:'开始探索',
        ouying1:'偶影衣形',
        ouying2:'《大名府》服饰色彩',
        ouying3:'《大名府》',
        ouying4:'《大名府》讲述了宋元时期，梁山的英雄好汉为了搭救义士卢俊义，在元宵节化妆成各种杂耍',
        ouying5:'艺人，捉弄了大名府的城门官和衙役一番后，混入城内救人的故事。',
        ouying6:'开始探索',
        tansuo1:'探索木偶世界',
        tansuo2:'跟随我们一起，了解更多布袋木偶戏艺术',
        tansuo3:'历史发展',
        tansuo4:'经典赏析',
        tansuo5:'演出活动',
        zhoubian1:'周边产品',
        zhoubian2:'如果您喜欢我们的周边设计请随时与我们联系。',
        wenyang11:'鱼鳞纹',
        wenyang12:' 盛开的牡丹象征繁花似锦，富贵吉祥。',
        wenyang21:'交枝牡丹纹',
        wenyang22:' 盛开的牡丹象征繁花似锦，富贵吉祥。',
        wenyang31:'菊花组合纹',
        wenyang32:'象征高洁、坚韧的品格。',
        wenyang41:'宝相回纹',
        wenyang42:'宝相花象征富贵吉祥，回纹象征永恒和连续，两者结合传达了富贵长久、好运连绵的美好愿望。',
        wenyang51:'坐龙纹',
        wenyang52:'象征至高无上的皇权和威严，寓意着统治者的权力和神圣不可侵犯的地位。',
        wenyang61:'菊花卷草纹',
        wenyang62:'象征着坚韧不拔和高洁的品格',
        wenyang71:'全卧水纹',
        wenyang72:'象征着柔和和宁静的力量感。',
        wenyang81:'牡丹团花纹',
        wenyang82:'象征高贵典雅、富丽堂皇。',
        wenyang91:'如意回纹',
        wenyang92:'象征着和谐与幸福的生活状态。',
        about1:'致点开网页的你：',
        about2:'作为地地道道的福建人，我希望将我身边优秀的传统文化传递给更多的人，闽南布袋木偶戏作为福建戏剧的瑰宝，',
        about3:'陪伴了一代又一代人的成长。木偶在升级，演员在换新，观众在更迭，但不变的是刻在福建人心中的“看戏情怀”；',
        about4:'今天，我以这样的形式为大家展现了闽南布袋木偶戏的很小一部分，希望您能喜欢；未来，也将会上线更多内容；',
        about5:'让我们一起期待。',
        lishi11:' 学界对于南派布袋木偶戏的起源变革尚无明确定论，但学界内存在两种观点：',
        lishi12:'  （一）以白勇华、洪世键为代表的一派认为南派布袋木偶戏产生于东晋时期，流行于宋代，盛行于清代。（二）是以叶明生为代表的一派认为南派布袋木偶戏产生于南宋时期，在明代流行，盛于清代。两个派别对于南派布袋木偶戏的起源有所分歧，但对其盛行时期的判断是一致的。',
        lishi21:' 东晋',
        lishi22:' 《拾遗记》中所记录的："南陲之南，有扶娄之国，其人善机巧变化……或于掌中备百戏之乐，宛转屈曲于指间。人形或长数分，或复数寸，神怪倏忽，玄丽于时……"',
        lishi31:' 五 代：',
        lishi32:'  五代晋江人谭峭所著《化书·海鱼》载:“观傀儡之假而不自疑.......”',
        lishi41:' 唐·敦煌莫高窟第31窟壁画局部图',
        lishi42:' 唐代',
        lishi51:' 宋·《蕉石婴戏图》',
        lishi52:' 宋代',
        lishi61:' 南 宋',
        lishi62:'  兴化人刘克庄(1187-1269)在其所作诗歌《己未元日》中说到:“久向优场脱戏衫，亦无布袋杖头担。”',
        lishi71:' 明 代',
        lishi72:' 《永春县志》卷十八《文化志) 载:“明天启年间，永春有两台木偶戏: 一是太平村李顺父子的布袋木偶;一是卿园村张森兄弟的提线木偶。”',
        lishi81:'  清 代',
        lishi82:'《晋江县志》卷之七十二《风俗志》载:“木头戏，俗名傀儡。近复有掌中弄巧，俗名布袋戏演唱一场各成音节。”',
        
    },
    'en-US': {
        nav1: 'Prologue',
        nav2: 'pattern',
        nav3: 'Color',
        nav4: 'Shape',
        langButton: 'English',
        Minnan:' Minnan cloth bag puppet show',
        Minnantext1:'Minnan cloth bag puppetry is one of the representative operas of Fujian puppetry, carrying rich historical and cultural connotations. It takes the southern Fujian puppet tune as the main singing tone and absorbs part of the Liyuan opera and Southern music. And in the performance into the local history and culture and folk customs, gave the drama life breath; With exquisite carving skills and traditional drama costumes, it becomes the treasure of Fujian drama.',
        Minnantext2:'The contents of this exhibition are divided into three parts: ornament drama -- dress patterns of "Women in the Middle of the Kui"; Brocade rhyme -- Dress color in Li Dong Fake Patrol Case; I shadow clothes shape -- "Daiming Mansion" clothing shape.',
        font1:'About Us',
        font2:'Help Center',
        font3:'Educational Resources',
        font4:'© Minnan Puppet 2024, all rights reserved',
        weishi1:'Decorative drama',
        weishi2:'"Li Dong fake patrol case" dress pattern',
        weishi3:'Li Dongs Fake Investigation',
        weishi4:'"Li Dong fake patrol case" tells the story of the Ming Dynasty Tianqi years, Li Dong "fake and real", instead of the real patrol according to Li Yanbin will be venal Suzhou',
        weishi5:' Governor Zhang Chun, Governor Fang Yubi justice story.',
        weishi6:'Start exploring',
        jinse1:'The color of the play rhyme',
        jinse2:'"Female Champion" dress color',
        jinse3:'"Woman in the Kui" tells the story of full Jiao Rong and her husband to the capital to catch the exam, on the way to meet pirates, full Jiao Rong fell into the sea as a guard, separated from her husband,',
        jinse4:'In order to find a husband, a woman dressed as a man, went through difficulties, became a champion for the court, and with their own perseverance and wisdom, with her husband',
        jinse5:'In order to find a husband, a woman dressed as a man, went through difficulties, became a champion for the court, and with their own perseverance and wisdom, with her husband',
        jinse6:'The Queen of Women',
        jinse7:'Start exploring',
        ouying1:'My shadow is in shape',
        ouying2:'"Daimyo" dress color',
        ouying3:'"Daimyo" dress color',
        ouying4:'"Daimyu" tells the story of the Song and Yuan dynasties, Liangshan heroes in order to rescue the hero Lu Junyi, in the Lantern Festival dressed up in various acrobatics',
        ouying5:'The artist, after playing tricks on the gate officers and yamen of the Daimyo Mansion, mixed into the city to save the story.',
        ouying6:'Start exploring',
        tansuo1:'Explore the world of puppets',
        tansuo2:'Follow us to learn more about the art of cloth bag puppetry',
        tansuo3:'Historical development',
        tansuo4:'Classical appreciation',
        tansuo5:'Performance activit',
        zhoubian1:'Peripheral products',
        zhoubian2:'If you like our peripheral design, please feel free to contact us.',
        wenyang11:'Fish scale pattern',
        wenyang12:' The peony in full bloom is a symbol of prosperity and auspiciousness.',
        wenyang21:'Cross branch peony pattern',
        wenyang22:' The peony in full bloom is a symbol of prosperity and auspiciousness.',
        wenyang31:'Chrysanthemum combination pattern',
        wenyang32:'A symbol of noble, tough character.',
        wenyang41:'Treasure phase back grain',
        wenyang42:'The flower symbolizes wealth and auspiciousness, and the thread symbolizes eternity and continuity. The combination of the two conveys the good wish of wealth for a long time and good luck.',
        wenyang51:'Sitting dragon design',
        wenyang52:'It symbolizes the supreme imperial power and majesty, and implies the power and sacred and inviolable status of the ruler.',
        wenyang61:'Chrysanthemum roll grass pattern',
        wenyang62:'A symbol of perseverance and noble character',
        wenyang71:'Full horizontal water pattern',
        wenyang72:'It symbolizes a sense of gentle and serene power.',
        wenyang81:'Peony pattern',
        wenyang82:'Symbolizing nobility, elegance and grandeur.',
        wenyang91:'Ruyi feedback',
        wenyang92:'It symbolizes a harmonious and happy life.',
        about1:'To you who click on this page:',
        about2:'As a native of Fujian, I hope to pass on the excellent traditional culture around me to more people. Minnan cloth bag puppet Show is a treasure of Fujian drama.',
        about3:'Accompanied the growth of generation after generation. The puppets are upgrading, the actors are changing, the audience is changing, but what remains unchanged is the "feeling of watching the play" in the hearts of Fujian people;',
        about4:'Today, I show you a small part of Minnan cloth bag puppet show in this form, I hope you like it; In the future, more content will be posted;',
        about5:' Let’s look forward to it.',
        lishi11:' There is no clear conclusion on the origin and reform of Nanpai cloth bag puppet show in the academic circle, but there are two viewpoints in the academic circle:',
        lishi12:'  (1) One faction, represented by Bai Yonghua and Hong Shijian, believes that the Southern School of cloth bag puppetry originated in the Eastern Jin Dynasty, was popular in the Song Dynasty, and prevailed in the Qing Dynasty. (2) The school represented by Ye Mingsheng believes that the puppet show of the Southern School of cloth bags originated in the Southern Song Dynasty, became popular in the Ming Dynasty and flourished in the Qing Dynasty. The two factions differ on the origins of the Southern School of cloth puppetry, but agree on the period of its popularity.',
        lishi21:' The Eastern Jin Dynasty (917-907)',
        lishi22:' As recorded in the book of Collecting Relics: "In the south of the southern border, there is the country of Fuluo, and the people are good at changing... Or in the palm of a hundred plays of joy, as flexion in the fingers. The human form is a few minutes long, or a plural inch, the spirit is suddenly strange, and the mysterious beauty is in time..." ',
        lishi31:' The fifth generation:',
        lishi32:'  Tan Qiao, a native of Jinjiang in the Five dynasties, wrote "Huashu · Sea Fish" : "Look at the puppet’s fake without self-doubt......."',
        lishi41:' Tang Dunhuang Mogao Grottoes No. 31 cave fresco partial picture',
        lishi42:' Tang Dynasty',
        lishi51:'Song · "Jiao Shi Baby Play"',
        lishi52:' Song Dynasty',
        lishi61:' The Southern Song Dynasty',
        lishi62:' Liu Kezhuang (1187-1269), a native of Xinghua, said in his poem "Yiwei Yuan Day" : "For a long time to the excellent field to take off the drama shirt, but also have no cloth bag and rod head."',
        lishi71:' Ming Dynasty',
        lishi72:' "Annals of Yongchun County" volume 18 "Cultural Annals" said: "In the year of tomorrow Qi, there were two puppet shows in Yongchun: one is the bag puppet of Li Shun and his son in Taiping village; the other is the string puppet of Zhang Sen brothers in Qingyuan Village."',
        lishi81:'  Qing Dynasty',
        lishi82:'"Annals of Jinjiang County" volume 72 "Custom" contained: "Wood play, common name puppet. In recent years, there is a handy hand, the common name of the cloth bag play singing a each syllable." ',
    }
};

let currentLang = 'zh-CN';

function switchLanguage() {
    currentLang = currentLang === 'zh-CN' ? 'en-US' : 'zh-CN';
    updateContent();
    localStorage.setItem('language', currentLang);
}

function updateContent() {
    document.querySelectorAll('[data-lang]').forEach(element => {
        const key = element.getAttribute('data-lang');
        if (key === 'title') {
            document.title = languageData[currentLang][key];
        } else {
            element.textContent = languageData[currentLang][key];
        }
    });
}

document.getElementById('langToggle').addEventListener('click', switchLanguage);

// 初始化语言
const savedLang = localStorage.getItem('language');
if (savedLang) {
    currentLang = savedLang;
    updateContent();
}



